package com.isp.aut.server.reference;

import com.isp.common.model.user.GroupDTO;
import com.isp.common.model.user.PermissionDTO;
import com.isp.common.model.vo.Result;
import com.isp.org.api.client.IResourceClient;
import com.isp.org.api.dto.Resource;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Set;

/**
 * @author linsy
 * @version 1.0
 * @created 2024/3/12 14:12
 */
@Component
public class ResourceReference {

    @DubboReference
    private IResourceClient iResourceClient;

    public Result<Set<Resource>> resources() {
        return iResourceClient.resources();
    }

    public Result<Set<Resource>> resources(String username) {
        return iResourceClient.resources(username);
    }

    public Result<List<PermissionDTO>> permissions(PermissionDTO permissionDTO) {
        return iResourceClient.permissions(permissionDTO);
    }

    public Result<List<GroupDTO>> groups(String username) {
        return iResourceClient.groups(username);
    }

    public void saveResource(Resource resource) {

    }

}
